/*
 * This class have the rules to calculate payment history's item
 */

package com.src.uniandes.ecos.tsp.creditscore.algorithm;

import com.src.uniandes.ecos.tsp.creditscore.entity.ClienteProducto;
import com.src.uniandes.ecos.tsp.creditscore.entity.HistorialCrediticio;
import com.src.uniandes.ecos.tsp.creditscore.jpa.ClienteProductoJpaController;
import com.src.uniandes.ecos.tsp.creditscore.jpa.HistorialCrediticioJpaController;
import java.util.ArrayList;
import java.util.List;


/**
 *
 * @author Administrador
 */
public class RulesPaymentHistory {

    /**
     * This method obtains the points for payments on time about a client
     * @param c The client to calculate
     * @return Number of points for payments on time
     */
    double getPointsPaymentsOnTime(Integer codigo) {
        ClienteProductoJpaController controllerCliente = new ClienteProductoJpaController();
        HistorialCrediticioJpaController controllerHistorialCrediticio = new HistorialCrediticioJpaController();
        List<ClienteProducto> listClienteProducto = new ArrayList<ClienteProducto>();
        HistorialCrediticio historialCrediticio =  new HistorialCrediticio();
        listClienteProducto = controllerCliente.findClienteProductoEntities(codigo);
        for (int i=0;i<listClienteProducto.size() ;i++){
            historialCrediticio = controllerHistorialCrediticio.findLastHistorialCrediticio (listClienteProducto.get(i));
        }
        return 0.1;
    }

    /**
     * This method returns the points that a client obtains according to number of accounts asociated
     * @param c The client to calculate
     * @return Number of points according to number of accounts associated
     */
    double getPointsNumberOfAccountsAssociated(Integer codigo) {
        ClienteProductoJpaController controllerCliente = new ClienteProductoJpaController();
        List<ClienteProducto> listClienteProducto = new ArrayList<ClienteProducto>();
        listClienteProducto = controllerCliente.findClienteProductoEntities(codigo);
        return 0.1;
    }

    /**
     * This method obtains the number of points according to pending debt
     * @param c The client to calculate
     * @return Number of points according to pending debt
     */
    double getPointsAccordingToDebt(Integer codigo){
        return 0.1;
    }

    /**
     * This method returns the number of negative ratings according to the customer
     * @param c The client to calculate
     * @return Number of negative ratings
     */
    double getPointsOfNegativeRatings(Integer codigo){
        return 0.1;
    }
}
